#!/bin/bash
/usr/sbin/ip_start
pid=$(pidof pacemaker-remoted)
if [ "$?" -ne 0 ];  then
	mkdir -p /var/run

	export PCMK_debugfile=$pcmklogs
	(pacemaker-remoted &) & > /dev/null 2>&1
	sleep 5

	pid=$(pidof pacemaker-remoted)
	if [ "$?" -ne 0 ]; then
		echo "startup of pacemaker failed"
		exit 1
	fi
	echo "$pid" > /var/run/pacemaker-remoted.pid
fi
exit 0
